/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.netmaster.coitaonline.dao.Impl;

import com.netmaster.coitaonline.dao.ServidorDao;
import com.netmaster.coitaonline.dao.mapper.ServidorMapper;
import com.netmaster.coitaonline.pojo.Servidor;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Abelgtzz
 */
@Repository
public class ServidorDaoImpl implements ServidorDao {
    
    private JdbcTemplate jdbcTemplate;
    static final String select = "select * from servidor "; 
            
    @Autowired
    public void setDataSource(DataSource dataSource) {
        this.jdbcTemplate = new JdbcTemplate(dataSource);
    }

    @Override
    public List<Servidor> getListServidor() {
        List<Servidor> lst = null;
        
        lst  = jdbcTemplate.query(select,new ServidorMapper());
        return lst;
    }
    


}
